package com.neo4j.neo4jService;

import com.neo4j.neo4jDao.DeptRepository;
import com.neo4j.node.DeptEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptService {

    @Autowired
    private DeptRepository deptRepository;

    public Iterable<DeptEntity> saveAll(List<DeptEntity> depts) {
        return deptRepository.saveAll(depts);
    }

    public void deleteById(Long id) {
        deptRepository.deleteById(id);
    }

    public void deleteAll() {
        deptRepository.deleteAll();
    }

    public List<DeptEntity> findByTitle(String title) {
        return deptRepository.findByTitle(title);
    }
}